<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMessageTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('message_templates', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('agent_id')->index()->comment('代理ID');
            $table->string('title', 256)->comment('站内信标题');
            $table->longText('content')->comment('站内信模板内容');
            $table->dateTime('publish_time')->comment('发布时间');
            $table->string('publish_status', 16)->default(\App\Enums\MessagePublishStatus::INIT)->comment('消息发布状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('message_templates');
    }
}
